<?php
  
	if (!defined('EXPONENT')) exit('');
	$cat = null;
	$id = 0;
	if(isset($_REQUEST['id']))
	{
		$id = intval($_REQUEST['id']);
		$cat = $db->selectObject('surveymodule_catergory',"id=".$id);
		$loc = unserialize($loc->location_data);
	}
	if($cat){
		if (exponent_permissions_check(array('administrate', "configure","delete"),$loc)) {
			$db->delete('surveymodule_catergory',"id=".$id);
			// TODO: Not done, must clear all surveys
		} else {

		}
	}
	else {

	}
	exponent_flow_redirect(SYS_FLOW_ACTION);
?>
